Skip to content

Fix GH-19320: Prevent FPM UID and GID overflow - #22986

Open
prateekbhujel wants to merge 1 commit into
php:PHP-8.4from
prateekbhujel:prateek/fix-gh-19320-fpm-id-overflow
Open

Fix GH-19320: Prevent FPM UID and GID overflow#22986
prateekbhujel wants to merge 1 commit into
php:PHP-8.4from
prateekbhujel:prateek/fix-gh-19320-fpm-id-overflow

Conversation

@prateekbhujel

Copy link
Copy Markdown
Contributor

FPM parses numeric user, group, listen.owner, and listen.group values with strtoul(), but stores them in signed int fields. That can silently change an ID before it reaches setuid(), setgid(), or chown().

This stores the values in uid_t/gid_t and rejects IDs that the platform types cannot represent during config validation. It also rejects the all-bits-one value used by chown() as its no-change sentinel.

I added coverage for all four numeric directives and ran the full FPM test suite.

Fixes GH-19320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant